<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./echarts.js"></script>
    <style>
          #main{
            border: 1px solid skyblue;
            margin: 100px auto;
        }
    </style>
</head>
<body>
    <div id="main" style="width: 600px; height: 400px;"></div>
    <script>
        let myChart = echarts.init(document.querySelector('#main'))
        let option = {
            title:{
                text:'性别,入会方式标准条形柱状图'
            },
            tooltip:{
              
            },
            legend:{
                data:['男性','女性'],
                right:0,
                top:10
            },
            yAxis:{
                data:['节日活动','自愿','微信推广','团购促销']
            },
            xAxis:[
            {
                    type: 'value',  //设置柱状图
                    boundaryGap: [0, 0.01],
                },

            ],
            series:[
                {
                    name:'男性',
                    type:'bar',
                    data:[2,2,0,1]
                },
                {
                    name:'女性',
                    type:'bar',
                    data:[2,3,2,2]
                }
            ],
        };
        myChart.setOption(option)
    </script>
</body>
</html>